package com.tiancheng.trade.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 资金预授权状态
 */
@Getter
@AllArgsConstructor
public enum CreditOrderAuthStatusEnum {
    INIT("INIT", "创建授权订单"),
    SUCCESS("SUCCESS", "用户已确认授权"),
    CLOSED("CLOSED", "业务已完结"),
    ;
    private String code;
    private String desc;

    public static String getDesc(String code) {
        CreditOrderAuthStatusEnum[] businessModeEnums = values();
        for (CreditOrderAuthStatusEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return null;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
